home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / windows2 / icobar.zip / README.TXT < prev    next >
Text File  |  1992-01-08  |  12KB  |  312 lines

  1. toolwnd.dll - ToolBar/ToolBox creator for Windows 3.0
  2. =====================================================
  3. This is a DLL which allows you to create great looking toolbars and toolboxes
  4. similar to those found in such programs as Microsoft(R) Excel, Microsoft(R) Word,
  5. and Microsoft(R) Visual Basic.  If you can draw a bitmap (or have someone else
  6. draw one), you can use toolwnd.dll to create the nice toolbar or toolbox you've
  7. always wanted for your application.  The only other DLL I've seen which allows
  8. you to do this is almost $300, and that doesn't even include source code!  This
  9. DLL may not be as fancy but it is extremely fast and it's only $35
  10. ($75 with source). A demo program with source has been included to show the
  11. power of such a DLL. For those of you who have been waiting for this, sorry
  12. about the wait!
  13.  
  14. This readme file contains the following information:
  15.  
  16.    1) A brief description of how to create great looking bitmaps that the
  17.       DLL will use to draw the toolbar/toolbox.
  18.  
  19.    2) Two methods of accessing the DLL.
  20.  
  21.    3) Detailed descriptions of DLL functions and structure definitions.
  22.  
  23.    4) Ordering information.
  24.  
  25.  
  26. I. Drawing the bitmap
  27. =====================
  28. The bitmap for a toolbar or toolbox contains pictures for each tool in each of
  29. its possible states.  If your application will run on EGA or monochrome
  30. monitors, you will need a separate bitmap for each monitor type.  The bitmaps
  31. included with the demo application were designed for VGA (color or monochrome).
  32.  
  33. Toolbar
  34. -------
  35.    The toolbar bitmap consists of (nTools * tool_width) columns and
  36.    (4 * tool_height) rows.  Each tool in the toolbar is represented by 4
  37.    possible states: normal, down, selected and disabled.  For the bitmaps
  38.    included with the demo, the width of each tool is 24 and the height of
  39.    each tool is 22.  This seems to be the optimal dimensions for VGA.
  40.  
  41. Toolbox
  42. -------
  43.    The toolbox bitmap consists of (nTools * tool_width) columns and
  44.    (3 * tool_height) rows.  Each tool in the toolbox is represented by 3
  45.    possible states: normal, selected and disabled.  For the bitmaps included
  46.    with the demo, the width and height of each tool is 28.  The tools look
  47.    best if they are square.  This is left to your discretion.
  48.  
  49. The best way to see how the bitmap is drawn is to look at the four bitmaps
  50. which come with the demo program.  They are:
  51.  
  52.    clr1.bmp    Contains the color bitmap for the toolbox.
  53.    clr2.bmp    Contains the color bitmap for the toolbar.
  54.    bw1.bmp     Contains the black and white bitmap for the toolbox.
  55.    bw2.bmp     Contains the black and white bitmap for the toolbar.
  56.  
  57. Since you control how each tool looks in each of its states, you can be very
  58. creative in determining how your toolbar or toolbox looks.  Some of the pictures
  59. I used are actually "borrowed" from other applications.  I used the Borland
  60. Resource Workshop to extract them and then "cut" and "paste" them using another
  61. paint program to form one bitmap.  Use whatever tools are available to you.  You
  62. are limited only by what your paint program can do.
  63.  
  64. II. Two methods of accessing the DLL.
  65. =====================================
  66. There are 2 methods of accessing the functions in toolwnd.dll.
  67.  
  68.    Method 1
  69.    --------
  70.    Add the file toolwnd.lib to your link line.  This is the easiest method
  71.    but causes the DLL to be loaded as soon as your application starts.  The
  72.    lib file contains all of the exported functions for toolwnd.dll.
  73.  
  74.    Method 2
  75.    --------
  76.    In you code, make an explicit call to LoadLibrary() to load the DLL.  This
  77.    can be done in the WM_CREATE case for you main window procedure.  The DLL
  78.    must then be unloaded in the WM_DESTROY case for your main window procedure.
  79.  
  80.       case WM_CREATE:
  81.          hLib = LoadLibrary((LPSTR)"toolwnd.dll");
  82.  
  83.          if (hLib < 32)
  84.             break;                           /* This means the load failed */
  85.  
  86.          .
  87.          .
  88.          .
  89.  
  90.       case WM_DESTROY:
  91.          if (hLib)                           /* If the library was loaded, */
  92.             hLib = FreeLibrary(hLib);        /* free it */
  93.          break;
  94.  
  95.    Note: The file "toolwnd.dll" must be either in the directory where your
  96.          application is being run from or in some directory where Windows will
  97.          find it. (i.e. c:\windows, c:\windows\system etc.)
  98.  
  99. III. Function/Structure definitions and descriptions.
  100. ================================================
  101. HWND CreateToolbox(hWnd,hbmTools,nTools,x,y,cx,cy,fVisible,lptInfo)
  102.  
  103.    This function creates a toolbox window.
  104.  
  105.    Parameter   Type/Description
  106.    ---------   ----------------
  107.    hWnd        HWND-Identifies the parent or owner of the toolbox.
  108.                Note:  The toolbox must have a parent window!
  109.  
  110.    hbmTools    HBITMAP-Specifies a handle to the bitmap which
  111.                contains the tools.
  112.  
  113.    nTools      int-Specifies the number of tools in the toolbox.
  114.  
  115.    x           short-Specifies the starting x position (in
  116.                client coordinates) for the toolbox.
  117.  
  118.    y           short-Specifies the starting y position (in
  119.                client coordinates) for the toolbox.
  120.  
  121.    cx          short-Specifies the number of columns in the
  122.                toolbox.
  123.  
  124.    cy          short-Specifies the numner of rows in the
  125.                toolbox.
  126.  
  127.    fVisible    BOOL-Specifies whether or not to show the toolbox.
  128.  
  129.    lptInfo     LPTOOLINFO-Specifies a pointer to a TOOLINFO
  130.                structure.  (See description of TOOLINFO structure below.)
  131.  
  132. Return Value   The return value identifies the new toolbox window.  It is NULL
  133.                if the window could not be created.
  134.  
  135. ===============================================================================
  136. HWND CreateToolbar(hWnd,hbmTools,nTools,fVisible,lptInfo)
  137.  
  138.    This function creates a toolbar window.
  139.  
  140.    Parameter   Type/Description
  141.    ---------   ----------------
  142.    hWnd        HWND-Identifies the parent or owner of the toolbar.
  143.                Note:  The toolbar must have a parent window!
  144.  
  145.    hbmTools    HBITMAP-Specifies a handle to the bitmap which
  146.                contains the tools.
  147.  
  148.    nTools      int-Specifies the number of tools in the toolbar.
  149.  
  150.    fVisible    BOOL-Specifies whether or not to show the toolbar.
  151.  
  152.    lptInfo     LPTOOLINFO-Specifies a pointer to a TOOLINFO
  153.                structure.  (See description of TOOLINFO structure below.)
  154.  
  155. Return Value   The return value identifies the new toolbar window.  It is NULL
  156.                if the window could not be created.
  157.  
  158. ===============================================================================
  159. BOOL IsToolSelected(hWnd,wId)
  160.  
  161.    This function determines if the tool specified by the wId parameter is
  162.    selected or not.
  163.  
  164.    Parameter   Type/Description
  165.    ---------   ----------------
  166.    hWnd        HWND-Identifies a toolbar or toolbox window.
  167.  
  168.    wId         WORD-Specifies the command id of the desired tool.
  169.  
  170. Return Value   The return value is TRUE if the given tool is selected, otherwise
  171.                it is FALSE.
  172.  
  173. ===============================================================================
  174. void EnableTool(hWnd,wId,fEnable)
  175.  
  176.    This function enables or disables the tool specified by the wId parameter.
  177.  
  178.    Parameter   Type/Description
  179.    ---------   ----------------
  180.    hWnd        HWND-Identifies a toolbar or toolbox window.
  181.  
  182.    wId         WORD-Specifies the command id of the desired tool.
  183.  
  184.    fEnable     BOOL-Specifies whether to enable or disable the
  185.                tool.
  186.  
  187. Return Value   None.
  188.  
  189. ===============================================================================
  190. void ToggleTools(hWnd,wIdFirstTool,wIdLastTool,wIdCheckTool)
  191.                                                         
  192.    This function selects the tool specified by the wIdCheckTool parameter.
  193.    It removes the selection from all other tools in the group of tools
  194.    specified by the wIdFirstTool and wIdLastTool parameters.
  195.  
  196.    Parameter      Type/Description
  197.    ---------      ----------------
  198.    hWnd           HWND-Identifies a toolbar or toolbox window.
  199.  
  200.    wIdFirstTool   WORD-Specifies the id of the first tool in a
  201.                   group.
  202.  
  203.    wIdLastTool    WORD-Specifies the id of the last tool in a
  204.                   group.
  205.  
  206.    wIdCheckTool   WORD-Specifies the id of the tool to be checked.
  207.  
  208. Return Value   None.
  209.  
  210. ===============================================================================
  211. void CheckTool(hWnd,wIdCheck,fCheck)
  212.  
  213.    This function selects or de-selects the tool specified by the wIdCheck
  214.    parameter.
  215.  
  216.    Parameter   Type/Description
  217.    ---------   ----------------
  218.    hWnd        HWND-Identifies a toolbar window.
  219.  
  220.    wIdCheck    WORD-Specifies the id of the tool to be checked.
  221.  
  222.    fCheck      BOOL-Specifies whether to check or uncheck the
  223.                tool.
  224.  
  225. Return Value   None.
  226.  
  227. ===============================================================================
  228. TOOLINFO    Structure Description
  229.  
  230.    The TOOINFO structure provides information to CreateToolbox() or
  231.    CreateToolbar() functions for creating a toolbox or toolbar.
  232.  
  233.    typedef struct
  234.    {
  235.       WORD wId;
  236.       DWORD dwStyle;
  237.       WORD wState;
  238.       RECT rc;
  239.    } TOOLINFO;
  240.  
  241.    The TOOLINFO structure has the following fields:
  242.  
  243.    Field       Description
  244.    -----       -----------
  245.    wId         Specifies the command id for a tool.  The parent window will
  246.                receive a WM_COMMAND message with wParam as this id, whenever
  247.                the tool is clicked or selected.
  248.  
  249.    dwStyle     This field is used for the toolbar window only.  It specifies
  250.                whether to start a new group with this tool.  It is either
  251.                WS_GROUP or NULL.  A tool with the style of WS_GROUP will
  252.                start 10 pixels from the previous tool.  A tool without this
  253.                style will be placed right next to the previous tool.
  254.  
  255.    wState      This is used internally by the toolwnd.dll and should be set to
  256.                0.
  257.  
  258.  
  259.    rc          This contains the bounding rectangle for each tool.  This field
  260.                is calculated internally by toolwnd.dll and should be set to 0.
  261.  
  262. ===============================================================================
  263. Example:
  264.  
  265.    The following is an example of how to initialize a TOOLINFO structure and
  266.    call the function CreateToolbar() to create a toolbar window:
  267.  
  268.    TOOLINFO tInfo[nTools]=
  269.    {
  270.       IDM_TOOL1,WS_GROUP,0,{0,0,0,0},        /* First group of tools */
  271.       IDM_TOOL2,NULL,0,{0,0,0,0},
  272.       IDM_TOOL3,NULL,0,{0,0,0,0},
  273.       IDM_TOOL4,WS_GROUP,0,{0,0,0,0},        /* Start new group */
  274.       .
  275.       .
  276.       .
  277.       IDM_TOOLN,NULL,0,{0,0,0,0}
  278.    };
  279.  
  280.    hWndToolbar = CreateToolbar(hWnd,hbmTools,nTools,TRUE,(LPTOOLINFO)&tInfo);
  281.  
  282. IV.  Ordering Information
  283. ==========================
  284. To register your royalty free copy of toolwnd.dll send $35.00 check or money
  285. order (sorry no credit cards) to the following address:
  286.  
  287.    Ray Donahue
  288.    365 Mather Street Unit 125
  289.    Hamden, CT 06514
  290.  
  291.    Home Phone: (203) 230-9877
  292.    Work Phone: (203) 399-7111
  293.  
  294. For inquiries or bug reports send Email to the following CompuServe address:
  295.  
  296.    Ray Donahue [70324,1204]
  297.  
  298. The source code for toolwnd.dll is also available for $75.00
  299.  
  300. By registering, you are entitled to any upgrades which become available and
  301. also information on other useful Windows tools.
  302.  
  303. Currently, the only other tool which is available is three_d.dll which
  304. makes a dialog box have a nice "3-dimensional" look.  A demo of this program
  305. can be found in the WINADV section of CompuServe LIB 1 (New Uploads) or
  306. LIB 12 (Utilities).  Search for keyword 3-D.
  307.  
  308. Package deals are also available!
  309.  
  310. Thanks,
  311. Ray Donahue
  312.